<?php
/**
 * Created by PhpStorm.
 * User: coderkim
 * Date: 18-8-22
 * Time: 上午12:48
 */

namespace app\controllers\v1;


use app\models\Post;
use yii\rest\ActiveController;
use yii\web\Response;

class PostController extends ActiveController
{
    public $modelClass = Post::class;

    public function behaviors()
    {
        $behaviors = parent::behaviors();
        $behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON;
        return $behaviors;
    }

    public function checkAccess($action, $model = null, $params = [])
    {
        parent::checkAccess($action, $model, $params); // TODO: Change the autogenerated stub
    }
}